package tool

import (
	"fmt"
	"github.com/bwmarrin/snowflake"
)

/**
 * @Author: LiuXu
 * @Author: xucooler@qq.com
 * @Date: 2021-02-09 14:36
 * @Desc:
 */

func GenerateID() string {
	// Create a new Node with a Node number of 1,must be between 0 and 1023
	node, err := snowflake.NewNode(1)
	if err != nil {
		fmt.Println(err)
		return err.Error()
	}

	// Generate a snowflake ID.
	id := node.Generate()
	return id.String()
}
